{{ block 'style' }}
  <style>
    #home {
      margin-right: 15px;
    }
  </style>
{{ /block }}
<nav class="navbar navbar-default">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button
        type="button"
        class="navbar-toggle collapsed"
        data-toggle="collapse"
        data-target="#bs-example-navbar-collapse-1"
        aria-expanded="false"
      >
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      
      <div class="navbar-form navbar-left">
        <a class="btn btn-default" id="home" href="/">首页</a>
      </div>

      <ul class="nav navbar-nav navbar-right">
        
        {{ if user }}
        <li class="dropdown">
          <a
            href="#"
            class="dropdown-toggle"
            data-toggle="dropdown"
            role="button"
            aria-haspopup="true"
            aria-expanded="false"
            >
            <span class="caret"></span
          ></a>
          <!-- 下拉菜单 -->
          <ul class="dropdown-menu">
            <li>
              <a href="#">当前用户: <strong>{{ user.name }}</strong></a>
            </li>
            <li>
              <a href="#">{{ if user.profession === 1 }} 工号 {{ else if user.profession === 0 }} 学号 {{ /if }}: 
                <strong>{{ user.user_num }}</strong></a>
            </li>
            <li role="separator" class="divider"></li>
            <li><a href="/logout">退出</a></li>
          </ul>

        </li>
        <a class="btn btn-default navbar-btn" href="/submithistory">提交记录</a>
        <!-- <a href="/logout" class="btn btn-success navbar-btn">退出</a> -->

        {{ else }}
        <a class="btn btn-primary navbar-btn" href="/login">登录</a>
        <a class="btn btn-success navbar-btn" href="/register">注册</a>
        {{ /if }}
      </ul>
    </div>
    <!-- /.navbar-collapse -->
  </div>
  <!-- /.container-fluid -->
</nav>
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/bootstrap/dist/js/bootstrap.js"></script>
